package cn.team11.smarteye.bean;

import java.util.Arrays;
import java.util.List;

/**
 * Created by Yang on 2017/10/28.
 *
 * 自定义事件
 */

public class CateyeEvent {

    //Event类型
    public static final int CATEYE_RESULT_LOGIN = 0;


    /**
     * 登录结果返回
     * */
    public static final class ResultLogin {
        public int code;

        public ResultLogin(int code) {
            this.code = code;
        }

        @Override
        public String toString() {
            return "ResultLogin{" +
                    "code=" + code +
                    '}';
        }
    }

    /**
    * 绑定请求事件
    * */
    public static final class RequestBinding {
        public String bdyname;

        public String[] extra;

        public String reqid;

        public String oldbdy;

        public RequestBinding(String bdyname, String[] extra, String reqid, String oldbdy) {
            this.bdyname = bdyname;
            this.extra = extra;
            this.reqid = reqid;
            this.oldbdy = oldbdy;
        }

        @Override
        public String toString() {
            return "RequestBinding{" +
                    "bdyname='" + bdyname + '\'' +
                    ", extra=" + Arrays.toString(extra) +
                    ", reqid='" + reqid + '\'' +
                    ", oldbdy='" + oldbdy + '\'' +
                    '}';
        }
    }

    /**
     * 绑定结果事件
     * */
    public static class ResultBinding {
        public int code;

        public ResultBinding(int code) {
            this.code = code;
        }


    }

    /**
     * 网络连接事件
     * */
    public static class NetworkEvent {
        public boolean isConnected;

        public NetworkEvent(boolean isConnected) {
            this.isConnected = isConnected;
        }
    }

    public static class CloseCurrentCallEvent {
        boolean isCalling;

        public CloseCurrentCallEvent(boolean isCalling) {
            this.isCalling = isCalling;
        }
    }

    public static class VideoCallOpenEvent {
        String uid;
        String bid;
        String name;
        String sid;
        String nick;

        public VideoCallOpenEvent(String uid, String bid, String name, String sid, String nick) {
            this.uid = uid;
            this.bid = bid;
            this.name = name;
            this.sid = sid;
            this.nick = nick;
        }


        public String getNick() {
            return nick;
        }

        public void setNick(String nick) {
            this.nick = nick;
        }

        public String getUid() {
            return uid;
        }

        public void setUid(String uid) {
            this.uid = uid;
        }

        public String getBid() {
            return bid;
        }

        public void setBid(String bid) {
            this.bid = bid;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getSid() {
            return sid;
        }

        public void setSid(String sid) {
            this.sid = sid;
        }
    }

    /**
     * 视频通话关闭事件
     * */
    public static class VideoCallCloseEvent {
        int resultCode;

        public VideoCallCloseEvent(int resultCode) {
            this.resultCode = resultCode;
        }

        @Override
        public String toString() {
            return "VideoCallCloseEvent{" +
                    "resultCode=" + resultCode +
                    '}';
        }

        public int getResultCode() {
            return resultCode;
        }

        public void setResultCode(int resultCode) {
            this.resultCode = resultCode;
        }
    }

    public static class IncomingCallPreviewEvent {
        public String getFid() {
            return fid;
        }

        public void setFid(String fid) {
            this.fid = fid;
        }

        String fid;

        public IncomingCallPreviewEvent(String fid) {
            this.fid = fid;
        }

        @Override
        public String toString() {
            return "IncomingCallPreviewEvent{" +
                    "fid='" + fid + '\'' +
                    '}';
        }
    }

    public static class DevicesFoundEvent {
        List<CateyeInfoBean>  devices;

        public DevicesFoundEvent(List<CateyeInfoBean> devices) {
            this.devices = devices;
        }

        public List<CateyeInfoBean> getDevices() {
            return devices;
        }
    }

    public static class SetNickEvent {
        public int code;

        public SetNickEvent(int code) {
            this.code = code;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        @Override
        public String toString() {
            return "SetNickEvent{" +
                    "code=" + code +
                    '}';
        }
    }

    public static class DeleteDeviceEvent{
        int code;

        public DeleteDeviceEvent(int code) {
            this.code = code;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        @Override
        public String toString() {
            return "DeleteDeviceEvent{" +
                    "code=" + code +
                    '}';
        }
    }

    public static class RestartEvent {
        int code;

        public RestartEvent(int code) {
            this.code = code;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        @Override
        public String toString() {
            return "RestartEvent{" +
                    "code=" + code +
                    '}';
        }
    }

    public static class EnablePirEvent{
        int code;

        public EnablePirEvent(int code) {
            this.code = code;
        }

        public int getCode() {
            return code;
        }
    }

    /**
     * 视频状态
     * */
    public static class VideoStatusEvent {
        int status;

        public VideoStatusEvent(int status) {
            this.status = status;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        @Override
        public String toString() {
            return "VideoStatusEvent{" +
                    "status=" + status +
                    '}';
        }
    }


    public static class PhoneCallEvent {
        int state;

        public PhoneCallEvent(int state) {
            this.state = state;
        }

        public int getState() {
            return state;
        }
    }

    public static class NewAlarmEvent {
        AlarmMsgInfoBean info;

        public NewAlarmEvent(AlarmMsgInfoBean info) {
            this.info = info;
        }

        public AlarmMsgInfoBean getInfo() {
            return info;
        }
    }

    public static class NewRingRecordEvent{
        RingRecordBean record;

        public NewRingRecordEvent(RingRecordBean record) {
            this.record = record;
        }

        public RingRecordBean getRecord() {
            return record;
        }
    }
}
